rmoutliers(HCV_array)
33 1 30 2 2 1 2 1 2 2 3178 4127797 12 180182 127 128 98 44 67 54 108 29 718359 664957 462214 456054 688986 15 4
35 1 26 2 2 1 2 1 2 2 8093 4144255 14 217810 95 75 73 93 43 90 127 38 1121894 95572 5 5 5 14 1
52 1 28 2 2 1 2 1 2 2 11065 4002769 15 148857 128 128 100 71 51 66 120 26 262262 595314 207550 87531 607145 9 3
56 1 24 2 2 1 2 1 2 2 5878 4564217 13 107505 62 107 104 121 73 120 73 32 1135021 126311 35471 725628 594410 9 1
45 1 35 2 2 1 2 1 2 2 4279 4796181 14 203108 99 90 118 71 105 64 84 23 76645 636923 18502 102445 243741 13 3
58 1 35 2 2 1 2 1 2 2 4972 4132934 15 118505 88 90 86 120 58 64 121 29 977436 1184754 554051 74441 112469 11 1
51 1 35 2 2 1 2 1 2 2 8795 4141988 12 163514 71 42 94 100 103 116 123 30 582174 331149 661693 161475 26065 6 4
36 1 24 2 2 1 2 1 2 2 9885 4622976 12 171369 122 59 53 128 55 101 81 27 667184 839870 791212 256983 35834 13 2
48 1 27 2 2 1 2 1 2 2 10098 4252898 14 223813 51 57 96 46 65 63 119 41 506343 808770 608544 319702 336238 5 3
% Without considering categorical data
[cdata,tf]=rmoutliers(HCV_array(:,[1,3,11:end]))
46 29 12101 4429425 10 129367 91 123 95 75 113 57 123 44 40620 538635 637056 336804 31085 4 2
49 33 6490 4794631 10 146457 43 64 109 80 88 48 77 33 1041941 449939 585688 744463 582301 10 3
58 22 11785 3882456 15 131228 66 104 121 96 65 73 114 29 1157452 1086852 5 5 5 4 4
42 26 11620 4747333 12 177261 78 57 113 118 107 84 80 28 325694 1034008 275095 214566 635157 12 4
48 30 7335 4405941 11 216176 119 112 80 127 45 96 53 39 641129 72050 787295 370605 506296 12 3
44 23 10480 4608464 12 148889 93 83 55 102 97 122 39 45 591441 757361 5 371090 203042 5 2
45 30 6681 4455329 12 98200 55 68 72 127 81 125 43 30 1151206 230488 267320 275295 555516 4 2
37 24 4437 4265042 12 166027 103 124 111 74 53 123 101 33 1023123 103190 731929 448466 59998 15 2
36 22 6052 4130219 13 144266 75 49 93 52 46 46 59 45 137712 1122999 561438 63145 806204 16 1
45 25 9279 4116937 13 203003 97 101 66 53 95 55 104 26 936444 536969 5 5 5 8 1
cdatat=array2table(cdata,'VariableNames',HCV.Properties.VariableNames([1,3,11:end]))
cdatat = 1381×21 table
| | Age | BMI | WBC | RBC | HGB | Plat | AST1 | ALT1 | ALT4 | ALT12 | ALT24 | ALT36 | ALT48 | ALTafter24w | RNABase | RNA4 | RNA12 | RNAEOT | RNAEF | BaselinehistologicalGrading | Baselinehistologicalstaging |
|---|
| 1 | 46 | 29 | 12101 | 4429425 | 10 | 129367 | 91 | 123 | 95 | 75 | 113 | 57 | 123 | 44 | 40620 | 538635 | 637056 | 336804 | 31085 | 4 | 2 |
|---|
| 2 | 49 | 33 | 6490 | 4794631 | 10 | 146457 | 43 | 64 | 109 | 80 | 88 | 48 | 77 | 33 | 1041941 | 449939 | 585688 | 744463 | 582301 | 10 | 3 |
|---|
| 3 | 58 | 22 | 11785 | 3882456 | 15 | 131228 | 66 | 104 | 121 | 96 | 65 | 73 | 114 | 29 | 1157452 | 1086852 | 5 | 5 | 5 | 4 | 4 |
|---|
| 4 | 42 | 26 | 11620 | 4747333 | 12 | 177261 | 78 | 57 | 113 | 118 | 107 | 84 | 80 | 28 | 325694 | 1034008 | 275095 | 214566 | 635157 | 12 | 4 |
|---|
| 5 | 48 | 30 | 7335 | 4405941 | 11 | 216176 | 119 | 112 | 80 | 127 | 45 | 96 | 53 | 39 | 641129 | 72050 | 787295 | 370605 | 506296 | 12 | 3 |
|---|
| 6 | 44 | 23 | 10480 | 4608464 | 12 | 148889 | 93 | 83 | 55 | 102 | 97 | 122 | 39 | 45 | 591441 | 757361 | 5 | 371090 | 203042 | 5 | 2 |
|---|
| 7 | 45 | 30 | 6681 | 4455329 | 12 | 98200 | 55 | 68 | 72 | 127 | 81 | 125 | 43 | 30 | 1151206 | 230488 | 267320 | 275295 | 555516 | 4 | 2 |
|---|
| 8 | 37 | 24 | 4437 | 4265042 | 12 | 166027 | 103 | 124 | 111 | 74 | 53 | 123 | 101 | 33 | 1023123 | 103190 | 731929 | 448466 | 59998 | 15 | 2 |
|---|
| 9 | 36 | 22 | 6052 | 4130219 | 13 | 144266 | 75 | 49 | 93 | 52 | 46 | 46 | 59 | 45 | 137712 | 1122999 | 561438 | 63145 | 806204 | 16 | 1 |
|---|
| 10 | 45 | 25 | 9279 | 4116937 | 13 | 203003 | 97 | 101 | 66 | 53 | 95 | 55 | 104 | 26 | 936444 | 536969 | 5 | 5 | 5 | 8 | 1 |
|---|
| 11 | 34 | 22 | 5638 | 4321603 | 14 | 141110 | 120 | 61 | 64 | 51 | 78 | 90 | 113 | 23 | 392976 | 884322 | 586834 | 182775 | 782154 | 9 | 2 |
|---|
| 12 | 40 | 32 | 11507 | 4165603 | 14 | 222874 | 127 | 122 | 106 | 105 | 88 | 111 | 111 | 36 | 1133727 | 1111871 | 421304 | 437544 | 124609 | 8 | 2 |
|---|
| 13 | 58 | 34 | 8035 | 4896464 | 11 | 149506 | 117 | 53 | 50 | 80 | 120 | 66 | 86 | 34 | 614951 | 314296 | 83690 | 671490 | 135145 | 15 | 1 |
|---|
| 14 | 61 | 35 | 10843 | 4165219 | 10 | 197640 | 86 | 105 | 70 | 86 | 83 | 87 | 47 | 33 | 900099 | 721460 | 5 | 5 | 5 | 3 | 4 |
|---|
| 15 | 55 | 24 | 8476 | 4466885 | 14 | 163276 | 53 | 101 | 50 | 95 | 112 | 97 | 68 | 27 | 1145310 | 230993 | 457882 | 318363 | 256415 | 4 | 3 |
|---|
| 16 | 56 | 27 | 6599 | 4448466 | 15 | 190642 | 53 | 124 | 62 | 76 | 57 | 46 | 93 | 26 | 506756 | 359181 | 743399 | 405175 | 162983 | 6 | 4 |
|---|
| 17 | 35 | 23 | 4845 | 4436025 | 10 | 111819 | 115 | 121 | 63 | 127 | 95 | 124 | 93 | 42 | 1080499 | 76404 | 717159 | 404314 | 477719 | 16 | 4 |
|---|
| 18 | 57 | 23 | 5925 | 4031637 | 15 | 116558 | 86 | 109 | 118 | 119 | 55 | 103 | 84 | 32 | 169624 | 786017 | 669076 | 531187 | 282524 | 6 | 2 |
|---|
| 19 | 33 | 25 | 9952 | 4994729 | 10 | 109023 | 84 | 77 | 67 | 81 | 117 | 68 | 42 | 32 | 1135200 | 572747 | 5 | 5 | 5 | 4 | 1 |
|---|
| 20 | 41 | 23 | 7961 | 4595487 | 14 | 94733 | 45 | 92 | 103 | 104 | 40 | 115 | 93 | 33 | 293380 | 440576 | 53098 | 18292 | 187341 | 10 | 3 |
|---|
| 21 | 39 | 29 | 7136 | 4625248 | 10 | 211363 | 70 | 102 | 76 | 58 | 111 | 95 | 58 | 25 | 993940 | 992652 | 96482 | 334897 | 762760 | 15 | 4 |
|---|
| 22 | 33 | 24 | 6057 | 4300774 | 11 | 222135 | 62 | 91 | 116 | 128 | 41 | 70 | 106 | 43 | 243433 | 981370 | 12504 | 360015 | 753383 | 6 | 3 |
|---|
| 23 | 43 | 34 | 6648 | 4529290 | 15 | 109871 | 48 | 112 | 99 | 85 | 59 | 87 | 78 | 35 | 955296 | 540654 | 5 | 5 | 5 | 9 | 4 |
|---|
| 24 | 51 | 34 | 11032 | 4052583 | 15 | 94503 | 41 | 54 | 128 | 64 | 71 | 89 | 87 | 34 | 766355 | 531269 | 737603 | 734863 | 372837 | 5 | 1 |
|---|
| 25 | 39 | 33 | 5234 | 4906158 | 12 | 190314 | 61 | 120 | 113 | 75 | 88 | 114 | 99 | 43 | 486467 | 45990 | 45578 | 733292 | 19572 | 15 | 2 |
|---|
| 26 | 57 | 26 | 6038 | 4763261 | 13 | 126721 | 51 | 118 | 98 | 42 | 93 | 53 | 83 | 45 | 285374 | 186657 | 5 | 5 | 5 | 9 | 3 |
|---|
| 27 | 47 | 29 | 5846 | 4753531 | 15 | 104729 | 120 | 72 | 117 | 126 | 45 | 95 | 49 | 38 | 426136 | 247777 | 767015 | 377123 | 315150 | 9 | 1 |
|---|
| 28 | 55 | 33 | 5383 | 3999388 | 15 | 182262 | 96 | 49 | 59 | 88 | 62 | 58 | 81 | 41 | 1194301 | 928679 | 29778 | 124250 | 244049 | 7 | 1 |
|---|
| 29 | 58 | 35 | 7378 | 3998925 | 10 | 201114 | 57 | 110 | 128 | 96 | 69 | 105 | 72 | 26 | 557708 | 287714 | 623587 | 66891 | 35044 | 5 | 2 |
|---|
| 30 | 47 | 25 | 7486 | 4599496 | 11 | 167354 | 94 | 64 | 54 | 122 | 64 | 64 | 96 | 24 | 604063 | 416313 | 323352 | 716655 | 678548 | 8 | 1 |
|---|
| 31 | 61 | 33 | 11770 | 4581099 | 13 | 125642 | 42 | 47 | 82 | 102 | 48 | 76 | 53 | 34 | 1159877 | 318505 | 463260 | 381345 | 282914 | 10 | 1 |
|---|
| 32 | 37 | 27 | 6441 | 4075477 | 11 | 118742 | 42 | 118 | 67 | 111 | 48 | 107 | 101 | 45 | 272600 | 91626 | 404523 | 674101 | 242552 | 11 | 3 |
|---|
| 33 | 41 | 29 | 10304 | 4152639 | 14 | 120812 | 128 | 102 | 79 | 63 | 80 | 86 | 127 | 40 | 1165166 | 51508 | 367178 | 588014 | 746328 | 16 | 3 |
|---|
| 34 | 60 | 32 | 7365 | 4023215 | 14 | 222471 | 52 | 126 | 67 | 126 | 126 | 41 | 54 | 35 | 112401 | 489112 | 461641 | 336006 | 287261 | 5 | 2 |
|---|
| 35 | 54 | 29 | 10704 | 4911615 | 10 | 171725 | 40 | 43 | 46 | 64 | 101 | 45 | 91 | 43 | 47190 | 581000 | 789780 | 262941 | 118971 | 15 | 1 |
|---|
| 36 | 40 | 28 | 3009 | 4354206 | 14 | 95604 | 69 | 58 | 62 | 50 | 60 | 84 | 114 | 31 | 961292 | 71146 | 28241 | 31034 | 1417 | 9 | 2 |
|---|
| 37 | 32 | 31 | 9956 | 3939529 | 14 | 196433 | 78 | 81 | 90 | 48 | 68 | 83 | 128 | 39 | 855099 | 102520 | 407306 | 220006 | 405497 | 7 | 4 |
|---|
| 38 | 58 | 33 | 6627 | 3889649 | 14 | 182897 | 106 | 69 | 127 | 99 | 47 | 103 | 111 | 33 | 1047535 | 320353 | 349454 | 546832 | 643942 | 13 | 1 |
|---|
| 39 | 37 | 23 | 10393 | 4308638 | 11 | 184113 | 93 | 56 | 40 | 124 | 101 | 50 | 90 | 33 | 271349 | 206329 | 151217 | 307729 | 174523 | 6 | 1 |
|---|
| 40 | 58 | 23 | 10236 | 4797923 | 14 | 101512 | 127 | 92 | 94 | 113 | 96 | 126 | 108 | 39 | 272507 | 1061189 | 230947 | 201997 | 293804 | 14 | 3 |
|---|
| 41 | 36 | 23 | 4387 | 4735873 | 14 | 177677 | 80 | 48 | 76 | 120 | 82 | 111 | 101 | 43 | 594248 | 1156859 | 436512 | 728279 | 685286 | 5 | 4 |
|---|
| 42 | 47 | 35 | 11924 | 3902488 | 14 | 97785 | 88 | 89 | 47 | 48 | 63 | 57 | 114 | 26 | 651671 | 422729 | 412086 | 91529 | 376394 | 12 | 3 |
|---|
| 43 | 50 | 33 | 10140 | 4570417 | 10 | 209827 | 105 | 116 | 106 | 111 | 84 | 107 | 71 | 35 | 57911 | 867787 | 758773 | 319688 | 159764 | 13 | 2 |
|---|
| 44 | 44 | 31 | 3470 | 4212499 | 12 | 150344 | 114 | 68 | 127 | 47 | 117 | 128 | 53 | 32 | 751073 | 825583 | 355919 | 100948 | 634168 | 11 | 4 |
|---|
| 45 | 43 | 33 | 5420 | 4281958 | 10 | 186992 | 113 | 40 | 42 | 42 | 78 | 106 | 57 | 28 | 740502 | 1197447 | 180453 | 524563 | 291808 | 15 | 2 |
|---|
| 46 | 54 | 33 | 6963 | 4972412 | 10 | 189400 | 125 | 48 | 118 | 59 | 70 | 105 | 110 | 25 | 851582 | 699521 | 678396 | 765773 | 546423 | 9 | 3 |
|---|
| 47 | 59 | 26 | 6249 | 4327627 | 12 | 138099 | 100 | 109 | 123 | 85 | 95 | 90 | 72 | 27 | 686065 | 49524 | 61646 | 704530 | 243265 | 15 | 1 |
|---|
| 48 | 33 | 31 | 5094 | 4679591 | 15 | 123295 | 84 | 71 | 62 | 117 | 82 | 116 | 105 | 42 | 973294 | 998745 | 756060 | 175062 | 241593 | 8 | 4 |
|---|
| 49 | 56 | 23 | 4797 | 4054154 | 14 | 175906 | 70 | 58 | 100 | 112 | 80 | 76 | 101 | 43 | 508849 | 130739 | 43228 | 300616 | 92124 | 13 | 2 |
|---|
| 50 | 41 | 33 | 5041 | 4143165 | 13 | 120871 | 115 | 93 | 109 | 48 | 56 | 76 | 100 | 43 | 118984 | 366238 | 13412 | 575116 | 331599 | 8 | 1 |
|---|
| 51 | 59 | 32 | 6901 | 4421722 | 12 | 212279 | 84 | 41 | 85 | 97 | 44 | 89 | 125 | 32 | 253848 | 257913 | 382306 | 672711 | 385161 | 5 | 2 |
|---|
| 52 | 47 | 27 | 7256 | 3939606 | 14 | 197798 | 55 | 84 | 124 | 59 | 113 | 44 | 67 | 44 | 598661 | 574070 | 356122 | 78520 | 607065 | 13 | 1 |
|---|
| 53 | 50 | 34 | 8219 | 4003477 | 14 | 217699 | 49 | 54 | 127 | 60 | 39 | 110 | 46 | 23 | 149650 | 208611 | 266578 | 53715 | 481377 | 11 | 2 |
|---|
| 54 | 39 | 30 | 4418 | 4651439 | 10 | 184013 | 82 | 75 | 53 | 75 | 95 | 96 | 44 | 32 | 232668 | 880198 | 175039 | 181268 | 184145 | 14 | 3 |
|---|
| 55 | 48 | 33 | 6358 | 4149153 | 15 | 120975 | 40 | 67 | 40 | 122 | 71 | 117 | 111 | 30 | 350564 | 150496 | 585077 | 6325 | 537325 | 13 | 4 |
|---|
| 56 | 32 | 27 | 8669 | 4616230 | 11 | 138648 | 75 | 46 | 56 | 120 | 84 | 91 | 56 | 23 | 502947 | 597869 | 339418 | 116953 | 793961 | 13 | 1 |
|---|
| 57 | 33 | 24 | 9435 | 4116304 | 13 | 130342 | 79 | 63 | 110 | 54 | 41 | 102 | 41 | 27 | 1010649 | 1152238 | 93316 | 639465 | 63629 | 3 | 1 |
|---|
| 58 | 51 | 26 | 11144 | 4844053 | 10 | 165099 | 73 | 73 | 60 | 82 | 107 | 79 | 42 | 32 | 192343 | 468140 | 97485 | 269115 | 163447 | 8 | 4 |
|---|
| 59 | 50 | 23 | 5060 | 4434372 | 13 | 138252 | 78 | 63 | 58 | 105 | 113 | 57 | 89 | 29 | 365429 | 239426 | 755513 | 290266 | 643822 | 12 | 3 |
|---|
| 60 | 42 | 23 | 7766 | 3961979 | 13 | 125625 | 109 | 89 | 42 | 60 | 42 | 72 | 55 | 26 | 620102 | 544738 | 740639 | 468459 | 208323 | 12 | 2 |
|---|
| 61 | 48 | 33 | 10879 | 4097792 | 15 | 163795 | 104 | 126 | 107 | 74 | 103 | 97 | 114 | 38 | 105958 | 216076 | 297086 | 755656 | 780066 | 9 | 1 |
|---|
| 62 | 45 | 31 | 11490 | 3878997 | 15 | 177809 | 121 | 65 | 71 | 44 | 100 | 128 | 110 | 27 | 420923 | 1109605 | 655703 | 753411 | 554612 | 9 | 2 |
|---|
| 63 | 58 | 28 | 4082 | 4731084 | 13 | 219590 | 98 | 86 | 53 | 118 | 128 | 103 | 119 | 26 | 175169 | 68868 | 632671 | 207722 | 258934 | 10 | 4 |
|---|
| 64 | 36 | 31 | 5078 | 4656201 | 15 | 199042 | 89 | 98 | 44 | 59 | 124 | 41 | 45 | 28 | 1177815 | 714160 | 93094 | 314177 | 102758 | 5 | 1 |
|---|
| 65 | 50 | 22 | 4580 | 4489031 | 14 | 170489 | 70 | 103 | 52 | 90 | 119 | 41 | 57 | 29 | 590244 | 290610 | 256588 | 94684 | 544054 | 14 | 4 |
|---|
| 66 | 40 | 23 | 7983 | 4872198 | 10 | 217563 | 106 | 127 | 94 | 89 | 98 | 80 | 61 | 35 | 727811 | 465753 | 382922 | 775458 | 24476 | 4 | 2 |
|---|
| 67 | 37 | 27 | 5500 | 3977714 | 14 | 203489 | 119 | 44 | 57 | 112 | 109 | 104 | 56 | 33 | 936761 | 737542 | 227389 | 410164 | 636763 | 15 | 3 |
|---|
| 68 | 39 | 35 | 3956 | 4316260 | 15 | 112273 | 107 | 127 | 98 | 116 | 91 | 114 | 76 | 41 | 632893 | 450196 | 368416 | 376627 | 703989 | 5 | 2 |
|---|
| 69 | 54 | 27 | 9532 | 4588105 | 15 | 162564 | 57 | 78 | 116 | 114 | 40 | 56 | 95 | 25 | 670969 | 1158751 | 706532 | 259979 | 190526 | 12 | 1 |
|---|
| 70 | 43 | 23 | 3555 | 4602228 | 13 | 159896 | 92 | 61 | 66 | 80 | 83 | 80 | 106 | 36 | 327706 | 927906 | 554740 | 375087 | 157528 | 4 | 3 |
|---|
| 71 | 61 | 25 | 4316 | 4479247 | 12 | 151526 | 71 | 113 | 83 | 94 | 45 | 49 | 128 | 30 | 1041041 | 99768 | 787815 | 413616 | 317021 | 6 | 4 |
|---|
| 72 | 44 | 28 | 7045 | 4622035 | 14 | 101254 | 95 | 127 | 57 | 124 | 87 | 120 | 75 | 40 | 265822 | 813 | 520004 | 484017 | 456419 | 7 | 4 |
|---|
| 73 | 59 | 25 | 7940 | 4330272 | 15 | 151597 | 39 | 101 | 91 | 113 | 95 | 110 | 44 | 32 | 922015 | 1146914 | 21081 | 136255 | 172170 | 13 | 1 |
|---|
| 74 | 32 | 24 | 11994 | 4194696 | 15 | 172915 | 79 | 62 | 104 | 58 | 94 | 115 | 89 | 22 | 168613 | 137240 | 550268 | 301626 | 234613 | 8 | 4 |
|---|
| 75 | 32 | 26 | 8870 | 4818572 | 14 | 135689 | 101 | 63 | 88 | 73 | 120 | 39 | 102 | 24 | 1114527 | 518344 | 611557 | 456092 | 402753 | 15 | 1 |
|---|
| 76 | 34 | 31 | 4250 | 4470537 | 11 | 220661 | 83 | 55 | 127 | 55 | 46 | 110 | 121 | 45 | 170527 | 1088486 | 72854 | 795019 | 433726 | 11 | 3 |
|---|
| 77 | 38 | 34 | 8702 | 4306848 | 14 | 223196 | 119 | 101 | 59 | 108 | 67 | 43 | 68 | 40 | 54743 | 390760 | 197060 | 388410 | 332045 | 8 | 4 |
|---|
| 78 | 61 | 26 | 5510 | 4680049 | 15 | 115867 | 108 | 63 | 100 | 51 | 96 | 86 | 101 | 39 | 570662 | 6556 | 569496 | 236595 | 627163 | 11 | 2 |
|---|
| 79 | 33 | 34 | 10654 | 4314617 | 11 | 113281 | 42 | 101 | 85 | 75 | 64 | 117 | 125 | 25 | 602200 | 45436 | 170540 | 196951 | 647645 | 8 | 2 |
|---|
| 80 | 56 | 30 | 9255 | 4752903 | 15 | 132694 | 66 | 69 | 96 | 109 | 114 | 95 | 50 | 26 | 422504 | 1025482 | 536220 | 450133 | 487629 | 11 | 1 |
|---|
| 81 | 56 | 26 | 5843 | 4852636 | 12 | 103575 | 59 | 105 | 122 | 94 | 126 | 82 | 71 | 32 | 1169124 | 161960 | 283093 | 237688 | 618676 | 15 | 4 |
|---|
| 82 | 34 | 34 | 11611 | 4217730 | 10 | 125068 | 60 | 94 | 63 | 93 | 70 | 89 | 43 | 30 | 1145156 | 823207 | 45613 | 447067 | 754430 | 5 | 3 |
|---|
| 83 | 39 | 31 | 6227 | 4503431 | 10 | 113199 | 65 | 128 | 81 | 106 | 126 | 103 | 78 | 34 | 694142 | 869130 | 51949 | 261800 | 188617 | 15 | 2 |
|---|
| 84 | 52 | 27 | 6798 | 3892146 | 12 | 151419 | 109 | 67 | 59 | 93 | 115 | 128 | 91 | 25 | 1168094 | 695791 | 409680 | 633247 | 96028 | 15 | 3 |
|---|
| 85 | 39 | 28 | 6622 | 3954021 | 11 | 106309 | 95 | 61 | 93 | 97 | 86 | 119 | 39 | 31 | 806186 | 323019 | 584277 | 463417 | 670622 | 4 | 4 |
|---|
| 86 | 37 | 33 | 10339 | 4946479 | 14 | 161613 | 83 | 108 | 104 | 110 | 61 | 69 | 70 | 28 | 683082 | 236960 | 709909 | 553085 | 563302 | 6 | 1 |
|---|
| 87 | 57 | 23 | 6038 | 4057999 | 13 | 127765 | 48 | 45 | 122 | 52 | 71 | 95 | 63 | 45 | 384512 | 1012307 | 301092 | 345055 | 574121 | 11 | 1 |
|---|
| 88 | 58 | 34 | 6028 | 3986814 | 12 | 212852 | 118 | 96 | 123 | 39 | 70 | 71 | 63 | 42 | 763624 | 592272 | 32776 | 359787 | 237850 | 13 | 2 |
|---|
| 89 | 45 | 25 | 10393 | 3861675 | 13 | 156095 | 85 | 70 | 42 | 63 | 72 | 128 | 79 | 32 | 488111 | 579154 | 372958 | 573360 | 437164 | 15 | 2 |
|---|
| 90 | 60 | 25 | 11110 | 4127397 | 10 | 99699 | 88 | 108 | 124 | 119 | 116 | 113 | 87 | 37 | 632868 | 342096 | 5 | 5 | 5 | 3 | 4 |
|---|
| 91 | 43 | 26 | 3739 | 4008145 | 11 | 131295 | 113 | 51 | 74 | 115 | 88 | 102 | 93 | 31 | 850603 | 1011234 | 113328 | 742762 | 378760 | 13 | 4 |
|---|
| 92 | 58 | 26 | 7255 | 4136958 | 12 | 142869 | 110 | 107 | 64 | 117 | 93 | 55 | 59 | 36 | 272423 | 1186503 | 660245 | 555642 | 498567 | 6 | 3 |
|---|
| 93 | 37 | 28 | 10303 | 4830312 | 13 | 197486 | 68 | 81 | 62 | 93 | 61 | 99 | 43 | 26 | 459679 | 1164871 | 5 | 5 | 5 | 9 | 4 |
|---|
| 94 | 40 | 31 | 7030 | 4322008 | 10 | 219360 | 104 | 70 | 61 | 64 | 118 | 99 | 62 | 41 | 873343 | 942992 | 798150 | 777618 | 394841 | 11 | 2 |
|---|
| 95 | 44 | 31 | 6292 | 3944957 | 11 | 192455 | 51 | 47 | 69 | 46 | 77 | 79 | 42 | 27 | 332660 | 642393 | 276746 | 123973 | 145977 | 15 | 1 |
|---|
| 96 | 36 | 34 | 11688 | 4622950 | 13 | 103521 | 52 | 76 | 107 | 112 | 123 | 84 | 120 | 27 | 746998 | 385015 | 5 | 5 | 5 | 14 | 2 |
|---|
| 97 | 60 | 28 | 8839 | 4372638 | 12 | 213687 | 105 | 128 | 69 | 64 | 50 | 77 | 64 | 23 | 80837 | 176811 | 206701 | 161492 | 123008 | 12 | 1 |
|---|
| 98 | 46 | 35 | 3101 | 4753125 | 10 | 206409 | 77 | 80 | 85 | 110 | 46 | 99 | 125 | 23 | 821552 | 364435 | 698425 | 452757 | 758186 | 9 | 4 |
|---|
| 99 | 56 | 27 | 11489 | 4542344 | 11 | 180872 | 97 | 96 | 75 | 86 | 58 | 104 | 111 | 31 | 685564 | 441952 | 571415 | 220033 | 739954 | 14 | 4 |
|---|
| 100 | 43 | 23 | 5495 | 3916999 | 13 | 166734 | 109 | 99 | 53 | 46 | 53 | 92 | 119 | 30 | 95028 | 1056078 | 5 | 5 | 5 | 4 | 4 |
|---|
| ⋮ |
|---|
HCV_array
46 1 29 1 2 2 1 2 2 1 12101 4429425 10 129367 91 123 95 75 113 57 123 44 40620 538635 637056 336804 31085 4 2
57 1 33 2 2 2 2 1 1 1 4178 4621191 12 151522 113 49 95 107 116 5 5 5 571148 661346 5 735945 558829 4 4
59 1 32 1 1 2 1 2 2 2 3661 4606375 11 187684 99 104 67 48 120 94 90 30 660410 738756 3731527 338946 242861 11 1
58 2 22 2 2 2 1 2 2 1 11785 3882456 15 131228 66 104 121 96 65 73 114 29 1157452 1086852 5 5 5 4 4
48 2 30 1 1 2 2 1 1 2 7335 4405941 11 216176 119 112 80 127 45 96 53 39 641129 72050 787295 370605 506296 12 3
44 1 23 1 1 2 2 2 1 2 10480 4608464 12 148889 93 83 55 102 97 122 39 45 591441 757361 5 371090 203042 5 2
45 1 30 2 1 2 2 1 1 2 6681 4455329 12 98200 55 68 72 127 81 125 43 30 1151206 230488 267320 275295 555516 4 2
37 2 24 2 1 2 1 2 2 1 4437 4265042 12 166027 103 124 111 74 53 123 101 33 1023123 103190 731929 448466 59998 15 2
36 1 22 2 2 1 1 1 1 1 6052 4130219 13 144266 75 49 93 52 46 46 59 45 137712 1122999 561438 63145 806204 16 1
45 2 25 2 1 1 1 2 1 2 9279 4116937 13 203003 97 101 66 53 95 55 104 26 936444 536969 5 5 5 8 1
% Stage and Continuous variables
sv(i,3)=range(cdatat.(i));
sv(i,4)=mean(cdatat.(i));
sv(i,5)=median(cdatat.(i));
sv(i,7)=corr(cdatat.(i),cdatat.(21));
array2table(sv,'RowNames',cdatat.Properties.VariableNames,"VariableNames",{'Minimum','Maximum','Range','Mean','Median','Std.Dev.','Correlation'})
ans = 21×7 table
| | Minimum | Maximum | Range | Mean | Median | Std.Dev. | Correlation |
|---|
| 1 Age | 32 | 61 | 29 | 46.3049 | 46 | 8.7717 | -0.0176 |
|---|
| 2 BMI | 22 | 35 | 13 | 28.5945 | 29 | 4.0731 | -0.0584 |
|---|
| 3 WBC | 2991 | 12101 | 9110 | 7.5388e+03 | 7514 | 2.6685e+03 | 0.0178 |
|---|
| 4 RBC | 3816422 | 5018451 | 1202029 | 4.4223e+06 | 4438465 | 3.4657e+05 | 0.0106 |
|---|
| 5 HGB | 10 | 15 | 5 | 12.5902 | 13 | 1.7135 | 0.0039 |
|---|
| 6 Plat | 93013 | 226464 | 133451 | 1.5835e+05 | 157916 | 3.8817e+04 | -0.0174 |
|---|
| 7 AST1 | 39 | 128 | 89 | 82.7581 | 83 | 25.9888 | -0.0240 |
|---|
| 8 ALT1 | 39 | 128 | 89 | 83.9240 | 83 | 25.9375 | 0.0389 |
|---|
| 9 ALT4 | 39 | 128 | 89 | 83.4359 | 83 | 26.5488 | -0.0163 |
|---|
| 10 ALT12 | 39 | 128 | 89 | 83.4967 | 84 | 26.0676 | -0.0013 |
|---|
| 11 ALT24 | 39 | 128 | 89 | 83.6524 | 83 | 26.2091 | -0.0052 |
|---|
| 12 ALT36 | 39 | 128 | 89 | 83.2795 | 84 | 26.1830 | -0.0015 |
|---|
| 13 ALT48 | 39 | 128 | 89 | 83.7958 | 84 | 26.0037 | -0.0088 |
|---|
| 14 ALTafter24w | 22 | 45 | 23 | 33.5025 | 34 | 6.9577 | 0.0404 |
|---|
| ⋮ |
|---|
% Stages and Categorical variables
cadat=HCV_array(:,[2,4:10,29]);
cs(2*j-1,1)=sum(cadat(:,j)==1 & cadat(:,9)==1); % Stage 1
cs(2*j-1,2)=sum(cadat(:,j)==1 & cadat(:,9)==2); % Stage 2
cs(2*j-1,3)=sum(cadat(:,j)==1 & cadat(:,9)==3); % Stage 3
cs(2*j-1,4)=sum(cadat(:,j)==1 & cadat(:,9)==4); % Stage 4
cs(2*j-1,5)=sum(cadat(:,j)==1); % Total
cs(2*j,1)=sum(cadat(:,j)==2 & cadat(:,9)==1); % Stage 1
cs(2*j,2)=sum(cadat(:,j)==2 & cadat(:,9)==2); % Stage 2
cs(2*j,3)=sum(cadat(:,j)==2 & cadat(:,9)==3); % Stage 3
cs(2*j,4)=sum(cadat(:,j)==2 & cadat(:,9)==4); % Stage 4
cs(2*j,5)=sum(cadat(:,j)==2); % Total
array2table(cs,'RowNames',{'Male','Female','Fever Absent','Fever Present','NausaeVomiting Absent',...
'NausaeVomiting Present','Headache Absent','Headache Present','Diarrhea Absent','Diarrhea Present',...
'Fatigue Absent','Fatigue Present','Jaundice Absent', 'Jaundice Present','GastricPain Absent', ...
'Gastric Pain Present'},'VariableNames',{'Stage 1','Stage 2','Stage 3','Stage 4','Total'})
ans = 16×5 table
| | Stage 1 | Stage 2 | Stage 3 | Stage 4 | Total |
|---|
| 1 Male | 172 | 181 | 162 | 190 | 705 |
|---|
| 2 Female | 164 | 149 | 192 | 171 | 676 |
|---|
| 3 Fever Absent | 157 | 159 | 166 | 186 | 668 |
|---|
| 4 Fever Present | 179 | 171 | 188 | 175 | 713 |
|---|
| 5 NausaeVomiting Absent | 180 | 171 | 165 | 170 | 686 |
|---|
| 6 NausaeVomiting Present | 156 | 159 | 189 | 191 | 695 |
|---|
| 7 Headache Absent | 167 | 168 | 180 | 181 | 696 |
|---|
| 8 Headache Present | 169 | 162 | 174 | 180 | 685 |
|---|
| 9 Diarrhea Absent | 160 | 171 | 178 | 178 | 687 |
|---|
| 10 Diarrhea Present | 176 | 159 | 176 | 183 | 694 |
|---|
| 11 Fatigue Absent | 175 | 158 | 183 | 176 | 692 |
|---|
| 12 Fatigue Present | 161 | 172 | 171 | 185 | 689 |
|---|
| 13 Jaundice Absent | 179 | 154 | 182 | 176 | 691 |
|---|
| 14 Jaundice Present | 157 | 176 | 172 | 185 | 690 |
|---|
| ⋮ |
|---|
array2table(corr(HCV_arr),'Rownames',dat.Properties.VariableNames,'VariableNames',dat.Properties.VariableNames)
ans = 29×29 table
| | Age | Gender | BMI | Fever | NauseaVomting | Headache | Diarrhea | Fatiguegeneralizedboneache | Jaundice | Epigastricpain | WBC | RBC | HGB | Plat | AST1 | ALT1 | ALT4 | ALT12 | ALT24 | ALT36 | ALT48 | ALTafter24w | RNABase | RNA4 | RNA12 | RNAEOT | RNAEF | BaselinehistologicalGrading | Baselinehistologicalstaging |
|---|
| 1 Age | 1.0000 | -0.0083 | -0.0274 | -0.0213 | -0.0241 | 0.0182 | 0.0454 | -0.0073 | 0.0088 | -0.0119 | 0.0138 | -0.0003 | -0.0125 | -0.0024 | -0.0157 | 0.0059 | 0.0327 | 0.0181 | 0.0044 | -0.0060 | 0.0300 | 0.0081 | 0.0218 | -0.0128 | 0.0004 | -0.0477 | -0.0286 | -0.0413 | -0.0185 |
|---|
| 2 Gender | -0.0083 | 1.0000 | 0.0075 | 0.0231 | -0.0383 | -0.0241 | 0.0153 | 0.0456 | 0.0007 | -0.0238 | 0.0276 | -0.0040 | 0.0000 | 0.0196 | -0.0125 | 0.0235 | -0.0122 | 0.0105 | -0.0180 | 0.0049 | -0.0222 | 0.0070 | -0.0134 | -0.0234 | -0.0313 | 0.0329 | -0.0185 | 0.0147 | 0.0100 |
|---|
| 3 BMI | -0.0274 | 0.0075 | 1.0000 | -0.0182 | 0.0060 | -0.0058 | -0.0251 | -0.0070 | -0.0733 | 0.0081 | 0.0375 | -0.0044 | 0.0585 | -0.0017 | 0.0026 | 0.0343 | 0.0029 | -0.0605 | 0.0088 | -0.0257 | -0.0044 | -0.0169 | -0.0181 | 0.0376 | -0.0103 | -0.0215 | -0.0439 | -0.0238 | -0.0565 |
|---|
| 4 Fever | -0.0213 | 0.0231 | -0.0182 | 1.0000 | -0.0053 | 0.0213 | -0.0183 | -0.0050 | -0.0036 | -0.0169 | -0.0332 | -0.0292 | -0.0201 | -0.0032 | -0.0116 | 0.0216 | -0.0159 | -0.0219 | -0.0487 | -0.0069 | 0.0031 | 0.0015 | -0.0020 | 0.0017 | 0.0217 | 0.0182 | -0.0105 | -0.0317 | -0.0298 |
|---|
| 5 NauseaVomting | -0.0241 | -0.0383 | 0.0060 | -0.0053 | 1.0000 | 0.0211 | 0.0079 | -0.0311 | 0.0022 | -0.0486 | -0.0221 | 0.0163 | 0.0142 | 0.0876 | 0.0096 | 0.0557 | -0.0228 | -0.0246 | 0.0382 | 0.0227 | -0.0437 | 0.0074 | 0.0069 | -0.0279 | -0.0112 | 0.0025 | 0.0198 | -0.0559 | 0.0550 |
|---|
| 6 Headache | 0.0182 | -0.0241 | -0.0058 | 0.0213 | 0.0211 | 1.0000 | 0.0196 | -0.0167 | 0.0080 | 0.0268 | -0.0430 | 0.0111 | -0.0290 | -0.0248 | 0.0055 | 0.0511 | 0.0380 | 0.0263 | 0.0109 | 0.0145 | -0.0059 | -0.0052 | 0.0242 | -0.0433 | 0.0116 | -0.0072 | -0.0079 | -0.0111 | -0.0027 |
|---|
| 7 Diarrhea | 0.0454 | 0.0153 | -0.0251 | -0.0183 | 0.0079 | 0.0196 | 1.0000 | -0.0268 | -0.0167 | 0.0224 | 0.0004 | -0.0167 | -0.0605 | 0.0286 | -0.0362 | 0.0602 | 0.0224 | -0.0649 | -0.0234 | 0.0072 | -0.0207 | -0.0016 | 0.0184 | -0.0001 | -0.0122 | 0.0189 | 0.0394 | 0.0321 | -0.0076 |
|---|
| 8 Fatiguegeneralizedboneache | -0.0073 | 0.0456 | -0.0070 | -0.0050 | -0.0311 | -0.0167 | -0.0268 | 1.0000 | 0.0080 | 0.0355 | -0.0152 | -0.0228 | -0.0014 | 0.0014 | 0.0231 | -0.0028 | -0.0727 | 0.0115 | -0.0009 | 0.0224 | -0.0069 | 0.0387 | -0.0046 | -0.0515 | 0.0330 | 0.0154 | 0.0064 | -0.0230 | 0.0139 |
|---|
| 9 Jaundice | 0.0088 | 0.0007 | -0.0733 | -0.0036 | 0.0022 | 0.0080 | -0.0167 | 0.0080 | 1.0000 | -0.0268 | 0.0285 | -0.0128 | -0.0238 | -0.0372 | 0.0167 | 0.0143 | 0.0157 | -0.0113 | -0.0073 | 0.0105 | 0.0187 | -0.0140 | 0.0281 | -0.0100 | 0.0321 | 0.0383 | 0.0245 | -0.0089 | 0.0197 |
|---|
| 10 Epigastricpain | -0.0119 | -0.0238 | 0.0081 | -0.0169 | -0.0486 | 0.0268 | 0.0224 | 0.0355 | -0.0268 | 1.0000 | 0.0370 | -0.0373 | -0.0027 | -0.0520 | 0.0368 | 0.0229 | -0.0645 | 0.0157 | -0.0170 | 0.0344 | 0.0045 | 0.0346 | 0.0044 | 0.0039 | 0.0313 | 0.0497 | 0.0829 | -0.0066 | -0.0522 |
|---|
| 11 WBC | 0.0138 | 0.0276 | 0.0375 | -0.0332 | -0.0221 | -0.0430 | 0.0004 | -0.0152 | 0.0285 | 0.0370 | 1.0000 | 0.0080 | 0.0098 | -0.0156 | -0.0055 | -0.0367 | -0.0124 | -0.0050 | -0.0117 | -0.0428 | -0.0147 | 0.0181 | 0.0155 | 0.0202 | -0.0528 | -0.0185 | -0.0472 | 0.0290 | 0.0172 |
|---|
| 12 RBC | -0.0003 | -0.0040 | -0.0044 | -0.0292 | 0.0163 | 0.0111 | -0.0167 | -0.0228 | -0.0128 | -0.0373 | 0.0080 | 1.0000 | 0.0430 | 0.0341 | 0.0159 | 0.0126 | -0.0314 | 0.0178 | 0.0123 | 0.0510 | -0.0568 | 0.0063 | 0.0062 | 0.0161 | -0.0613 | -0.0285 | -0.0066 | -0.0198 | 0.0077 |
|---|
| 13 HGB | -0.0125 | 0.0000 | 0.0585 | -0.0201 | 0.0142 | -0.0290 | -0.0605 | -0.0014 | -0.0238 | -0.0027 | 0.0098 | 0.0430 | 1.0000 | -0.0087 | -0.0138 | -0.0162 | 0.0238 | -0.0064 | 0.0035 | -0.0376 | -0.0270 | -0.0198 | -0.0520 | -0.0023 | 0.0103 | -0.0046 | 0.0052 | 0.0210 | 0.0035 |
|---|
| 14 Plat | -0.0024 | 0.0196 | -0.0017 | -0.0032 | 0.0876 | -0.0248 | 0.0286 | 0.0014 | -0.0372 | -0.0520 | -0.0156 | 0.0341 | -0.0087 | 1.0000 | -0.0031 | 0.0485 | -0.0250 | -0.0445 | -0.0014 | 0.0016 | -0.0066 | -0.0345 | -0.0411 | -0.0400 | 0.0489 | 0.0381 | 0.0056 | 0.0345 | -0.0175 |
|---|
| ⋮ |
|---|
heatmap(corr(dat.Variables,'rows','complete'),'XDisplayLabels',string(dat.Properties.VariableNames),'YDisplayLabels',string(dat.Properties.VariableNames));
% Takes longer to execute
[R1, pvalue1(i,1)]=corr(dat.(i),dat.(29));
pvalue2(i,1)=anova1(dat.(i),dat.(29),'off');
%[R3, pvalue3(i,1)]=corr(dat.(i),dat.(29),'type','Spearman'); for
%ordinal/categorical data only
% Boneferroni and Benjamin Hochberg method
%p_corrected3=27*pvalue3;
%table(pvalue1,p_corrected1,fdr1,pvalue2,p_corrected2,fdr2,pvalue3,p_corrected3,fdr3,'Rownames',dat.Properties.VariableNames(1:27),'VariableNames',{'Pearson_Pval','Pearson_Qval','Pearson_FDR','Anova_Pval','Anova_Qval','Anova_FDR','Spearman_Pval','Spearman_Qval','Spearman_FDR'})
table(pvalue1,p_corrected1,fdr1,pvalue2,p_corrected2,fdr2,'Rownames',dat.Properties.VariableNames(1:27),'VariableNames',{'Pearson_Pval','Pearson_Qval','Pearson_FDR','Anova_Pval','Anova_Qval','Anova_FDR'})
ans = 27×6 table
| | Pearson_Pval | Pearson_Qval | Pearson_FDR | Anova_Pval | Anova_Qval | Anova_FDR |
|---|
| 1 Age | 0.4921 | 13.2879 | 0.6142 | 0.3448 | 9.3088 | 1.0000 |
|---|
| 2 Gender | 0.7095 | 19.1560 | 0.5755 | 0.1010 | 2.7279 | 0.6476 |
|---|
| 3 BMI | 0.0359 | 0.9705 | 0.5831 | 0.0094 | 0.2531 | 0.2404 |
|---|
| 4 Fever | 0.2687 | 7.2544 | 0.4843 | 0.5496 | 14.8393 | 1.0000 |
|---|
| 5 NauseaVomting | 0.0410 | 1.1079 | 0.3329 | 0.1765 | 4.7642 | 0.9048 |
|---|
| 6 Headache | 0.9216 | 24.8833 | 0.5751 | 0.9870 | 26.6486 | 0.9372 |
|---|
| 7 Diarrhea | 0.7782 | 21.0114 | 0.5739 | 0.7432 | 20.0675 | 0.9528 |
|---|
| 8 Fatiguegeneralizedboneache | 0.6045 | 16.3216 | 0.5162 | 0.6153 | 16.6119 | 0.9279 |
|---|
| 9 Jaundice | 0.4642 | 12.5329 | 0.6276 | 0.3328 | 8.9850 | 1.0000 |
|---|
| 10 Epigastricpain | 0.0526 | 1.4189 | 0.2842 | 0.0871 | 2.3522 | 0.7445 |
|---|
| 11 WBC | 0.5241 | 14.1508 | 0.5002 | 0.7665 | 20.6963 | 0.8933 |
|---|
| 12 RBC | 0.7756 | 20.9410 | 0.5992 | 0.6444 | 17.4000 | 0.9179 |
|---|
| 13 HGB | 0.8966 | 24.2082 | 0.5818 | 0.7643 | 20.6360 | 0.9331 |
|---|
| 14 Plat | 0.5151 | 13.9078 | 0.5571 | 0.5917 | 15.9761 | 1.0000 |
|---|
| ⋮ |
|---|
% PCA without normalization
X=HCV_arr(:,1:end-2)
0.4828 0 0.5385 0 1.0000 1.0000 0 1.0000 1.0000 0 1.0000 0.5100 0 0.2724 0.5843 0.9438 0.6292 0.4045 0.8315 0.4228 0.9593 0.9750 0.0338 0.4482 0.1707 0.4166 0.0384
0.8621 0 0.8462 1.0000 1.0000 1.0000 1.0000 0 0 0 0.1303 0.6695 0.4000 0.4384 0.8315 0.1124 0.6292 0.7640 0.8652 0 0 0 0.4755 0.5503 0 0.9103 0.6896
0.9310 0 0.7692 0 0 1.0000 0 1.0000 1.0000 1.0000 0.0735 0.6572 0.2000 0.7094 0.6742 0.7303 0.3146 0.1011 0.9101 0.7236 0.6911 0.6250 0.5498 0.6147 1.0000 0.4193 0.2997
0.8966 1.0000 0 1.0000 1.0000 1.0000 0 1.0000 1.0000 0 0.9653 0.0549 1.0000 0.2864 0.3034 0.7303 0.9213 0.6404 0.2921 0.5528 0.8862 0.6000 0.9637 0.9044 0 0 0
0.5517 1.0000 0.6154 0 0 1.0000 1.0000 0 0 1.0000 0.4768 0.4904 0.2000 0.9229 0.8989 0.8202 0.4607 0.9888 0.0674 0.7398 0.3902 0.8500 0.5338 0.0600 0.2110 0.4584 0.6248
0.4138 0 0.0769 0 0 1.0000 1.0000 1.0000 0 1.0000 0.8221 0.6589 0.4000 0.4187 0.6067 0.4944 0.1798 0.7079 0.6517 0.9512 0.2764 1.0000 0.4924 0.6302 0 0.4590 0.2506
0.4483 0 0.6154 1.0000 0 1.0000 1.0000 0 0 1.0000 0.4050 0.5315 0.4000 0.0389 0.1798 0.3258 0.3708 0.9888 0.4719 0.9756 0.3089 0.6250 0.9585 0.1918 0.0716 0.3405 0.6855
0.1724 1.0000 0.1538 1.0000 0 1.0000 0 1.0000 1.0000 0 0.1587 0.3732 0.4000 0.5471 0.7191 0.9551 0.8090 0.3933 0.1573 0.9593 0.7805 0.7000 0.8518 0.0859 0.1961 0.5547 0.0740
0.1379 0 0 1.0000 1.0000 0 0 0 0 0 0.3360 0.2611 0.6000 0.3841 0.4045 0.1124 0.6067 0.1461 0.0787 0.3333 0.4390 1.0000 0.1146 0.9345 0.1505 0.0781 0.9949
0.4483 1.0000 0.2308 1.0000 0 0 0 1.0000 0 1.0000 0.6902 0.2500 0.6000 0.8242 0.6517 0.6966 0.3034 0.1573 0.6292 0.4065 0.8049 0.5250 0.7797 0.4468 0 0 0
stage=HCV_arr(:,29)
0.3333
1.0000
0
1.0000
0.6667
0.3333
0.3333
0.3333
0
0
[coeff,score,latent,~,explained]=pca(X);
explained
7.8728
7.6349
7.3168
7.2822
7.1734
6.9769
6.7102
6.4450
4.4477
3.3991
labels = string(round(b.YData,2));
text(xtips,ytips,labels,'HorizontalAlignment','center',...
'VerticalAlignment','bottom')
xlabel('Principal Component')
ylabel('Percentange of explained variances')
title('Principle Component Analysis')
gscatter(score(:,1),score(:,2),stage,'rkgb')
features=HCV.Properties.VariableNames(1:end-2)';
sortrows(table(features,PC1),'PC1','descend')
ans = 27×2 table
| | features | PC1 |
|---|
| 1 | 'NauseaVomting' | 0.5587 |
|---|
| 2 | 'Fatiguegeneralizedboneache' | 0.5562 |
|---|
| 3 | 'Gender' | 0.4201 |
|---|
| 4 | 'Epigastricpain' | 0.3312 |
|---|
| 5 | 'Headache' | 0.2555 |
|---|
| 6 | 'Diarrhea' | 0.1215 |
|---|
| 7 | 'ALT4' | 0.0514 |
|---|
| 8 | 'Plat' | 0.0401 |
|---|
| 9 | 'RNAEOT' | 0.0382 |
|---|
| 10 | 'Jaundice' | 0.0352 |
|---|
| 11 | 'ALT1' | 0.0288 |
|---|
| 12 | 'WBC' | 0.0284 |
|---|
| 13 | 'ALT24' | 0.0280 |
|---|
| 14 | 'RBC' | 0.0278 |
|---|
| ⋮ |
|---|
sortrows(table(features,PC2),'PC2','descend')
ans = 27×2 table
| | features | PC2 |
|---|
| 1 | 'Epigastricpain' | 0.6733 |
|---|
| 2 | 'Diarrhea' | 0.4349 |
|---|
| 3 | 'Headache' | 0.3718 |
|---|
| 4 | 'Gender' | 0.2903 |
|---|
| 5 | 'Jaundice' | 0.2519 |
|---|
| 6 | 'Fever' | 0.2106 |
|---|
| 7 | 'NauseaVomting' | 0.1121 |
|---|
| 8 | 'RNAEF' | 0.0827 |
|---|
| 9 | 'Fatiguegeneralizedboneache' | 0.0437 |
|---|
| 10 | 'RNAEOT' | 0.0386 |
|---|
| 11 | 'HGB' | 0.0356 |
|---|
| 12 | 'ALT1' | 0.0300 |
|---|
| 13 | 'Plat' | 0.0281 |
|---|
| 14 | 'Age' | 0.0204 |
|---|
| ⋮ |
|---|
sortrows(table(features,PC3),'PC3','descend')
ans = 27×2 table
| | features | PC3 |
|---|
| 1 | 'Fever' | 0.6592 |
|---|
| 2 | 'Gender' | 0.4542 |
|---|
| 3 | 'Headache' | 0.4376 |
|---|
| 4 | 'Diarrhea' | 0.3751 |
|---|
| 5 | 'Epigastricpain' | 0.0925 |
|---|
| 6 | 'HGB' | 0.0629 |
|---|
| 7 | 'Fatiguegeneralizedboneache' | 0.0590 |
|---|
| 8 | 'ALT1' | 0.0571 |
|---|
| 9 | 'ALT24' | 0.0387 |
|---|
| 10 | 'NauseaVomting' | 0.0357 |
|---|
| 11 | 'RNAEOT' | 0.0286 |
|---|
| 12 | 'WBC' | 0.0271 |
|---|
| 13 | 'BMI' | 0.0245 |
|---|
| 14 | 'AST1' | 0.0236 |
|---|
| ⋮ |
|---|
sortrows(table(features,PC4),'PC4','descend')
ans = 27×2 table
| | features | PC4 |
|---|
| 1 | 'Diarrhea' | 0.5267 |
|---|
| 2 | 'Jaundice' | 0.4861 |
|---|
| 3 | 'Headache' | 0.4606 |
|---|
| 4 | 'Gender' | 0.3342 |
|---|
| 5 | 'Fever' | 0.2572 |
|---|
| 6 | 'Fatiguegeneralizedboneache' | 0.2082 |
|---|
| 7 | 'Epigastricpain' | 0.2062 |
|---|
| 8 | 'Plat' | 0.0552 |
|---|
| 9 | 'AST1' | 0.0362 |
|---|
| 10 | 'BMI' | 0.0351 |
|---|
| 11 | 'ALT12' | 0.0343 |
|---|
| 12 | 'NauseaVomting' | 0.0303 |
|---|
| 13 | 'RNA4' | 0.0241 |
|---|
| 14 | 'RNAEF' | 0.0191 |
|---|
| ⋮ |
|---|
%K-means Clustering for continuous variables
idx=kmeans(HCV_arr(:,[1,3,11:end-2]),k_values(i));
s=silhouette(HCV_arr(:,[1,3,11:end-2]),idx);
table(k_values',s_score)
ans = 4×2 table
| | Var1 | s_score |
|---|
| 1 | 2 | 0.1424 |
|---|
| 2 | 3 | 0.1173 |
|---|
| 3 | 4 | 0.0992 |
|---|
| 4 | 5 | 0.0949 |
|---|
k=find(s_score==max(s_score))+1
idx=kmeans(HCV_arr(:,[1,3,11:end-2]),k);
silhouette(HCV_arr(:,[1,3,11:end-2]),idx)
%K-mediods clustering for categorical variables
idx=kmedoids(HCV_arr(:,[2,4:10]),k_values(i));
s=silhouette(HCV_arr(:,[2,4:10]),idx);
table(k_values',s_score)
ans = 4×2 table
| | Var1 | s_score |
|---|
| 1 | 2 | 0.1633 |
|---|
| 2 | 3 | 0.1518 |
|---|
| 3 | 4 | 0.1511 |
|---|
| 4 | 5 | 0.1544 |
|---|
k=find(s_score==max(s_score))+1
idx=kmedoids(HCV_arr(:,[2,4:10]),k);
silhouette(HCV_arr(:,[2,4:10]),idx)
idx=kmedoids(HCV_arr(:,[2,4:10]),4,"Distance","hamming");
silhouette(HCV_arr(:,[2,4:10]),idx)
idx=kmeans(HCV_arr(:,[1,3,11:end-2]),4);
silhouette(HCV_arr(:,[1,3,11:end-2]),idx)
idx=kmeans(HCV_arr,4,'Distance',"sqeuclidean");
[b1,dev1,stats1]=mnrfit(Xtrain,categorical(Ytrain))
-0.1953 -0.8443 -0.9515
0.2118 0.5923 0.1500
-0.0224 -0.1728 0.3051
0.6876 0.8584 0.5700
0.1058 0.0884 0.1316
-0.4134 -0.2606 -0.0699
-0.0394 0.0834 -0.0980
0.0816 -0.0387 0.1832
-0.1052 0.2235 -0.0598
-0.1781 0.2239 -0.0928
dev1 = 2.5845e+03
stats1 =
beta: [28×3 double]
dfe: 2817
sfit: 1.0147
s: 1
estdisp: 0
covb: [84×84 double]
coeffcorr: [84×84 double]
se: [28×3 double]
t: [28×3 double]
p: [28×3 double]
resid: [967×4 double]
residp: [967×4 double]
residd: [967×1 double]
[val,pred1]=max(mnrval(b1,Xtest)')
0.3511 0.4403 0.4777 0.4167 0.3284 0.3943 0.3315 0.4650 0.3022 0.4101 0.3884 0.3384 0.3986 0.4569 0.2635 0.3430 0.3275 0.3445 0.3295 0.3976 0.3175 0.4002 0.2898 0.2828 0.3060 0.3841 0.3760 0.3361 0.3321 0.3391 0.3499 0.3434 0.3215 0.3527 0.3868 0.3157 0.3163 0.4278 0.3411 0.3833 0.4077 0.3312 0.3146 0.3648 0.3859 0.2783 0.3162 0.3051 0.2943 0.3410
4 4 4 3 1 4 4 3 1 4 4 2 2 3 4 2 4 4 3 3 1 3 4 1 3 1 1 4 2 4 4 1 3 4 2 4 3 3 1 4 2 2 1 2 2 3 4 3 1 2
pred1=normalize(pred1','range')
1.0000
1.0000
1.0000
0.6667
0
1.0000
1.0000
0.6667
0
1.0000
accuracy1=sum(pred1==Ytest)/length(Ytest)
confusionmat(double(Ytest),double(pred1))
Error using confusionmat (line 66)
Class List in given inputs are different
index1=crossvalind('kfold',size(Xtrain,1),fold);
%Multinomial Logistic Regression
[b1,dev1,stats1]=mnrfit(Xtrain,categorical(Ytrain));
[~,pred1]=max(mnrval(b1,Xtest)');
pred1=normalize(pred1','range');
accuracy1(i)=sum(pred1==Ytest)/length(Ytest)
confusionmat(double(Ytest),double(pred1))
end
Class List in given sample
0
0.3333
0.6667
1.0000
Total Instance = 193
class1==>0
class2==>0.33333
class3==>0.66667
class4==>1
Confusion Matrix
predict_class1 predict_class2 predict_class3 predict_class4
______________ ______________ ______________ ______________
Actual_class1 11 7 7 21
Actual_class2 13 7 7 10
Actual_class3 18 12 11 25
Actual_class4 10 4 8 22
Multi-Class Confusion Matrix Output
TruePositive FalsePositive FalseNegative TrueNegative
____________ _____________ _____________ ____________
Actual_class1 11 41 35 106
Actual_class2 7 23 30 133
Actual_class3 11 22 55 105
Actual_class4 22 56 22 93
Class Accuracy Error Sensitivity Specificity Precision FalsePositiveRate F1_score MatthewsCorrelationCoefficient Kappa
____________________ ________ _______ ___________ ___________ _________ _________________ ________ ______________________________ _______
{'class1==>0' } 0.056995 0.94301 0.23913 0.72109 0.21154 0.27891 0.22449 0.038204 0.59773
{'class2==>0.33333'} 0.036269 0.96373 0.18919 0.85256 0.23333 0.14744 0.20896 0.045363 0.70163
{'class3==>0.66667'} 0.056995 0.94301 0.16667 0.82677 0.33333 0.17323 0.22222 0.0082675 0.58005
{'class4==>1' } 0.11399 0.88601 0.5 0.62416 0.28205 0.37584 0.36066 0.10615 0.49453
Over all valuses
Accuracy: 0.2642
Error: 0.7358
Sensitivity: 0.2737
Specificity: 0.7561
Precision: 0.2651
FalsePositiveRate: 0.2439
F1_score: 0.2541
MatthewsCorrelationCoefficient: 0.0495
Kappa: 0.4903
11 7 7 21
13 7 7 10
18 12 11 25
10 4 8 22
Class List in given sample
0
0.3333
0.6667
1.0000
Total Instance = 194
class1==>0
class2==>0.33333
class3==>0.66667
class4==>1
Confusion Matrix
predict_class1 predict_class2 predict_class3 predict_class4
______________ ______________ ______________ ______________
Actual_class1 11 7 11 21
Actual_class2 12 5 16 14
Actual_class3 19 12 4 14
Actual_class4 14 6 14 14
Multi-Class Confusion Matrix Output
TruePositive FalsePositive FalseNegative TrueNegative
____________ _____________ _____________ ____________
Actual_class1 11 45 39 99
Actual_class2 5 25 42 122
Actual_class3 4 41 45 104
Actual_class4 14 49 34 97
Class Accuracy Error Sensitivity Specificity Precision FalsePositiveRate F1_score MatthewsCorrelationCoefficient Kappa
____________________ ________ _______ ___________ ___________ _________ _________________ ________ ______________________________ _______
{'class1==>0' } 0.056701 0.9433 0.22 0.6875 0.19643 0.3125 0.20755 0.089284 0.5785
{'class2==>0.33333'} 0.025773 0.97423 0.10638 0.82993 0.16667 0.17007 0.12987 0.075468 0.6695
{'class3==>0.66667'} 0.020619 0.97938 0.081633 0.71724 0.088889 0.28276 0.085106 0.20704 0.62491
{'class4==>1' } 0.072165 0.92784 0.29167 0.66438 0.22222 0.33562 0.25225 0.040499 0.55653
Over all valuses
Accuracy: 0.1753
Error: 0.8247
Sensitivity: 0.1749
Specificity: 0.7248
Precision: 0.1686
FalsePositiveRate: 0.2752
F1_score: 0.1687
MatthewsCorrelationCoefficient: 0.1031
Kappa: 0.5453
11 7 11 21
12 5 16 14
19 12 4 14
14 6 14 14
Class List in given sample
0
0.3333
0.6667
1.0000
Total Instance = 194
class1==>0
class2==>0.33333
class3==>0.66667
class4==>1
Confusion Matrix
predict_class1 predict_class2 predict_class3 predict_class4
______________ ______________ ______________ ______________
Actual_class1 11 10 16 10
Actual_class2 9 10 18 10
Actual_class3 7 7 11 12
Actual_class4 20 15 14 14
Multi-Class Confusion Matrix Output
TruePositive FalsePositive FalseNegative TrueNegative
____________ _____________ _____________ ____________
Actual_class1 11 36 36 111
Actual_class2 10 32 37 115
Actual_class3 11 48 26 109
Actual_class4 14 32 49 99
Class Accuracy Error Sensitivity Specificity Precision FalsePositiveRate F1_score MatthewsCorrelationCoefficient Kappa
____________________ ________ _______ ___________ ___________ _________ _________________ ________ ______________________________ _______
{'class1==>0' } 0.056701 0.9433 0.23404 0.7551 0.23404 0.2449 0.23404 0.010855 0.61078
{'class2==>0.33333'} 0.051546 0.94845 0.21277 0.78231 0.2381 0.21769 0.22472 0.0051195 0.6269
{'class3==>0.66667'} 0.056701 0.9433 0.2973 0.69427 0.18644 0.30573 0.22917 0.0072036 0.59839
{'class4==>1' } 0.072165 0.92784 0.22222 0.75573 0.30435 0.24427 0.25688 0.02428 0.56042
Over all valuses
Accuracy: 0.2371
Error: 0.7629
Sensitivity: 0.2416
Specificity: 0.7469
Precision: 0.2407
FalsePositiveRate: 0.2531
F1_score: 0.2362
MatthewsCorrelationCoefficient: 0.0119
Kappa: 0.5084
11 10 16 10
9 10 18 10
7 7 11 12
20 15 14 14
0.2642 0.1753 0.2371 0.2021 0
Class List in given sample
0
0.3333
0.6667
1.0000
Total Instance = 193
class1==>0
class2==>0.33333
class3==>0.66667
class4==>1
Confusion Matrix
predict_class1 predict_class2 predict_class3 predict_class4
______________ ______________ ______________ ______________
Actual_class1 8 7 24 14
Actual_class2 12 7 7 16
Actual_class3 13 9 7 16
Actual_class4 7 12 17 17
Multi-Class Confusion Matrix Output
TruePositive FalsePositive FalseNegative TrueNegative
____________ _____________ _____________ ____________
Actual_class1 8 32 45 108
Actual_class2 7 28 35 123
Actual_class3 7 48 38 100
Actual_class4 17 46 36 94
Class Accuracy Error Sensitivity Specificity Precision FalsePositiveRate F1_score MatthewsCorrelationCoefficient Kappa
____________________ ________ _______ ___________ ___________ _________ _________________ ________ ______________________________ _______
{'class1==>0' } 0.041451 0.95855 0.15094 0.77143 0.2 0.22857 0.17204 0.085476 0.61605
{'class2==>0.33333'} 0.036269 0.96373 0.16667 0.81457 0.2 0.18543 0.18182 0.020094 0.66792
{'class3==>0.66667'} 0.036269 0.96373 0.15556 0.67568 0.12727 0.32432 0.14 0.15809 0.60026
{'class4==>1' } 0.088083 0.91192 0.32075 0.67143 0.26984 0.32857 0.2931 0.0074402 0.53751
Over all valuses
Accuracy: 0.2021
Error: 0.7979
Sensitivity: 0.1985
Specificity: 0.7333
Precision: 0.1993
FalsePositiveRate: 0.2667
F1_score: 0.1967
MatthewsCorrelationCoefficient: 0.0678
Kappa: 0.5300
8 7 24 14
12 7 7 16
13 9 7 16
7 12 17 17
0.2642 0.1753 0.2371 0.2021 0.2487
Class List in given sample
0
0.3333
0.6667
1.0000
Total Instance = 193
class1==>0
class2==>0.33333
class3==>0.66667
class4==>1
Confusion Matrix
predict_class1 predict_class2 predict_class3 predict_class4
______________ ______________ ______________ ______________
Actual_class1 9 14 13 13
Actual_class2 10 9 14 16
Actual_class3 17 8 7 18
Actual_class4 8 4 10 23
Multi-Class Confusion Matrix Output
TruePositive FalsePositive FalseNegative TrueNegative
____________ _____________ _____________ ____________
Actual_class1 9 35 40 109
Actual_class2 9 26 40 118
Actual_class3 7 37 43 106
Actual_class4 23 47 22 101
Class Accuracy Error Sensitivity Specificity Precision FalsePositiveRate F1_score MatthewsCorrelationCoefficient Kappa
____________________ ________ _______ ___________ ___________ _________ _________________ ________ ______________________________ _______
{'class1==>0' } 0.046632 0.95337 0.18367 0.75694 0.20455 0.24306 0.19355 0.061605 0.61599
{'class2==>0.33333'} 0.046632 0.95337 0.18367 0.81944 0.25714 0.18056 0.21429 0.0035219 0.64007
{'class3==>0.66667'} 0.036269 0.96373 0.14 0.74126 0.15909 0.25874 0.14894 0.124 0.61719
{'class4==>1' } 0.11917 0.88083 0.51111 0.68243 0.32857 0.31757 0.4 0.17022 0.51554
Over all valuses
Accuracy: 0.2487
Error: 0.7513
Sensitivity: 0.2546
Specificity: 0.7500
Precision: 0.2373
FalsePositiveRate: 0.2500
F1_score: 0.2392
MatthewsCorrelationCoefficient: 0.0898
Kappa: 0.5009
9 14 13 13
10 9 14 16
17 8 7 18
8 4 10 23
avg_accuracy_5=mean(accuracy1)
[b1,dev1,stats1]=mnrfit(Xtrain,categorical(Ytrain))
-0.3226
0.3322
-0.1850
0.5297
0.0117
-0.1470
-0.0704
0.0176
-0.0642
0.0563
dev1 = 1.3139e+03
stats1 =
beta: [28×1 double]
dfe: 939
sfit: 1.0148
s: 1
estdisp: 0
covb: [28×28 double]
coeffcorr: [28×28 double]
se: [28×1 double]
t: [28×1 double]
p: [28×1 double]
resid: [967×2 double]
residp: [967×2 double]
residd: [967×1 double]
[val,pred1]=max(mnrval(b1,Xtest)')
0.5851 0.5757 0.5320 0.5516 0.6350 0.6413 0.5259 0.5919 0.6021 0.6115 0.5524 0.5382 0.5062 0.5550 0.5170 0.5764 0.5766 0.6444 0.5531 0.6230 0.5541 0.5732 0.5799 0.5638 0.5393 0.5111 0.5296 0.5758 0.5595 0.5557 0.5056 0.5024 0.5596 0.5238 0.5090 0.5815 0.5141 0.5064 0.5254 0.5931 0.5395 0.5364 0.5369 0.5884 0.5800 0.5808 0.5296 0.5383 0.5902 0.5040
2 2 2 2 2 1 2 2 2 1 2 2 2 1 1 1 1 1 2 2 2 2 2 2 2 1 2 2 2 2 1 1 1 1 1 2 2 2 2 2 1 1 2 2 1 1 2 1 1 2
pred1=normalize(pred1','range')
accuracy1=sum(pred1==Ytest)/length(Ytest)
confusionmat(double(Ytest),double(pred1))
Class List in given sample
0
1
Total Instance = 414
class1==>0
class2==>1
Confusion Matrix
predict_class1 predict_class2
______________ ______________
Actual_class1 91 109
Actual_class2 78 136
Two-Class Confution Matrix
'' 'TruePositive' 'FalsePositive'
'FalseNegative' [ 91] [ 109]
'TrueNegative=TN' [ 78] [ 136]
Over all valuses
Accuracy: 0.5483
Error: 0.4517
Sensitivity: 0.4550
Specificity: 0.6355
Precision: 0.5385
FalsePositiveRate: 0.3645
F1_score: 0.4932
MatthewsCorrelationCoefficient: 0.0920
Kappa: 0.0910
index1=crossvalind('kfold',size(Xtrain,1),fold);
precision2=zeros(1,fold);
%Multinomial Logistic Regression
[b1,dev1,stats1]=mnrfit(Xtrain,categorical(Ytrain));
[~,pred1]=max(mnrval(b1,Xtest)');
pred1=normalize(pred1','range');
accuracy1(i)=sum(pred1==Ytest)/length(Ytest);
confusionmat(double(Ytest),double(pred1))
pred2=round(predict(b2,Xtest));
accuracy2(i)=sum(pred2==Ytest)/length(Ytest);
precision2(i)=sum(pred2==1 & Ytest==1)/sum(pred2==1);
recall2(i)=sum(pred2==1 & Ytest==1)/sum(Ytest==1);
end
Class List in given sample
0
1
Total Instance = 194
class1==>0
class2==>1
Confusion Matrix
predict_class1 predict_class2
______________ ______________
Actual_class1 38 55
Actual_class2 43 58
Two-Class Confution Matrix
'' 'TruePositive' 'FalsePositive'
'FalseNegative' [ 38] [ 55]
'TrueNegative=TN' [ 43] [ 58]
Over all valuses
Accuracy: 0.4948
Error: 0.5052
Sensitivity: 0.4086
Specificity: 0.5743
Precision: 0.4691
FalsePositiveRate: 0.4257
F1_score: 0.4368
MatthewsCorrelationCoefficient: 0.0174
Kappa: 0.0169
Class List in given sample
0
1
Total Instance = 193
class1==>0
class2==>1
Confusion Matrix
predict_class1 predict_class2
______________ ______________
Actual_class1 41 48
Actual_class2 44 60
Two-Class Confution Matrix
'' 'TruePositive' 'FalsePositive'
'FalseNegative' [ 41] [ 48]
'TrueNegative=TN' [ 44] [ 60]
Over all valuses
Accuracy: 0.5233
Error: 0.4767
Sensitivity: 0.4607
Specificity: 0.5769
Precision: 0.4824
FalsePositiveRate: 0.4231
F1_score: 0.4713
MatthewsCorrelationCoefficient: 0.0378
Kappa: 0.0377
Class List in given sample
0
1
Total Instance = 193
class1==>0
class2==>1
Confusion Matrix
predict_class1 predict_class2
______________ ______________
Actual_class1 37 62
Actual_class2 40 54
Two-Class Confution Matrix
'' 'TruePositive' 'FalsePositive'
'FalseNegative' [ 37] [ 62]
'TrueNegative=TN' [ 40] [ 54]
Over all valuses
Accuracy: 0.4715
Error: 0.5285
Sensitivity: 0.3737
Specificity: 0.5745
Precision: 0.4805
FalsePositiveRate: 0.4255
F1_score: 0.4205
MatthewsCorrelationCoefficient: 0.0529
Kappa: 0.0490
Class List in given sample
0
1
Total Instance = 194
class1==>0
class2==>1
Confusion Matrix
predict_class1 predict_class2
______________ ______________
Actual_class1 42 58
Actual_class2 30 64
Two-Class Confution Matrix
'' 'TruePositive' 'FalsePositive'
'FalseNegative' [ 42] [ 58]
'TrueNegative=TN' [ 30] [ 64]
Over all valuses
Accuracy: 0.5464
Error: 0.4536
Sensitivity: 0.4200
Specificity: 0.6809
Precision: 0.5833
FalsePositiveRate: 0.3191
F1_score: 0.4884
MatthewsCorrelationCoefficient: 0.1043
Kappa: 0.1000
Class List in given sample
0
1
Total Instance = 193
class1==>0
class2==>1
Confusion Matrix
predict_class1 predict_class2
______________ ______________
Actual_class1 45 41
Actual_class2 49 58
Two-Class Confution Matrix
'' 'TruePositive' 'FalsePositive'
'FalseNegative' [ 45] [ 41]
'TrueNegative=TN' [ 49] [ 58]
Over all valuses
Accuracy: 0.5337
Error: 0.4663
Sensitivity: 0.5233
Specificity: 0.5421
Precision: 0.4787
FalsePositiveRate: 0.4579
F1_score: 0.5000
MatthewsCorrelationCoefficient: 0.0649
Kappa: 0.0647
avg_accuracy_multinom=mean(accuracy1)
avg_accuracy_multinom = 0.5139
avg_accuracy_lm=mean(accuracy2)
avg_precision_lm=mean(precision2)
avg_precision_lm = 0.5302
avg_recall_lm=mean(recall2)
mdl1=fitlm(HCV_arr(:,[1:27]),HCV_array(:,29)>2,'CategoricalVars',{'x2','x4','x5','x6','x7','x8','x9','x10'})
newmdl1=step(mdl1)
1. Adding x6:x13, FStat = 6.9063, pValue = 0.0086867
m=fitlm(Xtrain(:,[3,5]),Ytrain)
m =
Linear regression model:
y ~ 1 + x1 + x2
Estimated Coefficients:
Estimate SE tStat pValue
_________ ________ ______ __________
(Intercept) 0.51172 0.038815 13.184 6.1446e-36
x1 -0.085468 0.057401 -1.489 0.1369
x2 0.080471 0.035843 2.2451 0.025047
Number of observations: 774, Error degrees of freedom: 771
Root Mean Squared Error: 0.499
R-squared: 0.00928, Adjusted R-Squared: 0.00671
F-statistic vs. constant model: 3.61, p-value = 0.0275
p=round(predict(m,Xtest(:,[3,5])))
acc=sum(pred2==Ytest)/length(Ytest)
prec=sum(pred2==1 & Ytest==1)/sum(pred2==1)
rec=sum(pred2==1 & Ytest==1)/sum(Ytest==1)